import java.awt.Font;
import java.util.ArrayList;

import javax.swing.UIManager;

import managers.RuleManager;
import rules.RuleGroup;
import rules.Rules;
import TextGeneration.Unification;

import components.Component;
import components.Leaf;
import components.Phrase;

import controller.MainController;
import features.Feature;

public class Driver {

	public static void main(String[] args){
		try{
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}catch(Exception e){}
		
		Font oldLabelFont = UIManager.getFont("Label.font");
		UIManager.put("Label.font", oldLabelFont.deriveFont(Font.PLAIN,(float)14));
		
		RuleManager rule = RuleManager.getInstance();
		RuleGroup rg =  (RuleGroup)rule.getRootNode();
		ArrayList<RuleGroup> groups = rg.getSubGroups();
		Rules pattern = groups.get(0).getRules().get(0).getRule(); // get from read rules
		Phrase input = (Phrase) Component.createInstance("CL", false);
		Phrase inner = (Phrase)Component.createInstance("adjp", false);
		Leaf innerer = (Leaf) Component.createInstance("adj", false);
		Feature feat = new Feature("Degree", "Superlative", true);
		innerer.addFeature(feat);
		inner.addChild(innerer);
		input.addChild(inner);
		
	
		System.out.println(pattern.getRuleName() + " WEEEEE");
		if(Unification.unify(pattern.getFirstComponentInInputToMatch(), input) == null)
			System.out.println("false");
		else
			System.out.println("true");
		new MainController();
	
	//	RuleTreeNode rootNode = RuleManager.getInstance().getRootNode();
	//	RuleManager.getInstance().editGroupName((RuleGroup)rootNode, "Rulesededes");

	}
}
